package com.rainripple.java.common.dao;

import java.util.List;

public interface IDao {

	void save(Object entity);//Insert
	
	void save(Class<?> cls, Object entity);//Insert
	
	int update(Object entity);//UpdateByPrimaryKey

	int update(Class<?> cls, Object entity);//UpdateByPrimaryKeySelective
	
	void delete(Object entity);//DeleteByPrimaryKey

	void delete(Class<?> entityClass, Object parameter);//DeleteSelective

	<T> T get(Class<T> entityClass,Object id);	//SelectByPrimaryKey
	
	<T> List<T> selectList(Class<T> entityClass);//SelectSelective
	
	<T> List<T> selectList(Class<T> entityClass,int limit, int start);//SelectSelective

	<T> List<T> selectList(Class<T> entityClass, T prarm);//SelectSelective

	<T> List<T> selectList(Class<T> entityClass, T prarm, int limit, int start);//SelectSelective
	
	int insert(String statement, Object parameter);

	int update(String statement, Object parameter);

	int delete(String statement, Object parameter);

	<T> T selectOne(String statement);

	<T> T selectOne(String statement, Object parameter);

	<E> List<E> selectList(String statement);

	<E> List<E> selectList(String statement, Object parameter);

	<E> List<E> selectList(String statement, Object parameter,  int limit, int start);

}
